package cn.itsource.service.impl;

import cn.itsource.domain.Order;
import cn.itsource.domain.Room;
import cn.itsource.fegin.RoomFeignClient;
import cn.itsource.mapper.OrderMapper;
import cn.itsource.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements IOrderService {

    @Autowired
    private OrderMapper orderMapper;
    @Autowired
    private RoomFeignClient roomFeignClient;

    @Override
    public Order getById(Integer id) {
        Order order = orderMapper.getById(id);
        Room room = roomFeignClient.getById(order.getRoomId());
        order.setRoomInfo(room);
        return order;
    }
}
